//
//  MyCouponViewController.m
//  ZiJinLian
//
//  Created by 🐛 on 2017/4/18.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "MyCouponViewController.h"
#import "CouponsViewController.h"
@interface MyCouponViewController ()

@property (nonatomic, strong) NSArray * titleDataArr;
@property (nonatomic, strong) NSArray * titleData;
@end

@implementation MyCouponViewController

#pragma mark 标题数组
- (NSArray *)titleData {
    if (!_titleData) {
        _titleData = @[@"详情", @"歌词",@"歌词"];
    }
    return _titleData;
}
#pragma mark 初始化代码
- (instancetype)init {
    if (self = [super init]) {
        
    }
    return self;
}
- (void)viewDidLoad {
    
    NSArray * titleDataArr = [NSArray arrayWithObjects:self.str1,self.str2,self.str3, nil];
    self.titleDataArr = titleDataArr;
    self.titleSizeNormal = 15;
    self.titleSizeSelected = 15;
    self.menuBGColor=[UIColor whiteColor];
    self.menuViewStyle = WMMenuViewStyleLine;
    self.itemsWidths =  @[@(100),@(100),@(100)];
    self.menuHeight = 50;
    
    [super viewDidLoad];
    self.title = @"我的优惠券";
    
}
#pragma mark - WMPageControllerDataSource
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController
{
    return self.titleData.count;
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index
{
    switch (index) {
            
        case 0: {
            CouponsViewController *vc = [[CouponsViewController alloc] init];
            
            return vc;
        }
            break;
        case 1: {
            CouponsViewController *vc = [[CouponsViewController alloc] init];
            
            return vc;
        }
            break;
            
        default: {
            CouponsViewController *vc = [[CouponsViewController alloc] init];
            return vc;
        }
            break;
    }
}

- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index
{
    return self.titleDataArr[index];
}

@end
